/**
 *  \file I3Params.h
 *  \brief Collects together the definitions of various i3 parameters.
*/

#ifndef I3_PARAMS_H
#define I3_PARAMS_H 1

#include "i3_client_params.h"

/** If a trigger acknowledgement is received before this period, the trigger
  * insertion must be retried or abandoned.
  */
#define I3_TRIGGER_INSERT_TIMEOUT 3


#define I3_TRIGGER_REFRESH_PERIOD   30
#define I3_ACK_TIMEOUT      2
#define I3_ID_REFRESH_PERIOD    30

/**
  * If we are using pings to choose the first hop i3 server,
  * how long (in seconds) should we wait before doing the first
  * update of the server list.  After the first update, future
  * updates will take place with the period SERVER_UPDATE
  * defined in i3_client_params.h
  */
#define INITIAL_SERVER_UPDATE_DELAY 5

/** How many times should a trigger tried to be inserted?  */
#define I3_MAX_NUM_TRIG_RETRIES 20

#define I3_MAX_NUM_ID_RETRIES   3

/** How many times can a privagte id be requested from a remote host? */
#define I3_MAX_NUM_REMOTE_PRIVATE_ID_REQUESTS 3

#define UMILLION 1000000ULL

#define I3_MIN_TRIGGER_REFRESH_PERIOD (I3_TRIGGER_REFRESH_PERIOD - I3_MAX_NUM_TRIG_RETRIES * I3_ACK_TIMEOUT)*3/4

#define I3_MAX_TRIGGER_REFRESH_PERIOD (I3_TRIGGER_REFRESH_PERIOD - I3_MAX_NUM_TRIG_RETRIES * I3_ACK_TIMEOUT)

/** How long to wait (in seconds) for a private trigger confirmation
 * from a remote end point before re-sending the private
 * trigger request.
 */
#define PRIVATE_TRIGGER_REQUEST_TIMEOUT 20

/** The default file to be searched for i3 public triggers. */
#define DEFAULT_PUBLIC_TRIGGER_FILE     "i3-public-triggers.xml"


#ifdef _WIN32
/** How often should the status in the registry be refresehed? */
#define UPDATE_STATUS_PERIOD 2 //seconds
#endif
#endif
